package leegproject.client;

import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.Grid;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.Image;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.MenuBar;
import com.google.gwt.user.client.ui.Panel;
import com.google.gwt.user.client.ui.RootPanel;
import com.google.gwt.user.client.ui.TabPanel;
import com.google.gwt.user.client.ui.TextArea;
import com.google.gwt.user.client.ui.TextBox;
import com.google.gwt.user.client.ui.VerticalPanel;

	/**
	* Entry point classes define <code>onModuleLoad()</code>.
	*/
public class LeegProject implements EntryPoint {
	
	TabPanel tp;
	TextBox tbMail;
	TextBox tbKenteken;
	TextBox tbGet1;
	TextBox tbGet2;
	VerticalPanel tp3 = new VerticalPanel();
	VerticalPanel tp4 = new VerticalPanel();
	VerticalPanel tp5 = new VerticalPanel();
	MenuBar mb;
	TabPanel tp2;
	Image newBanner = new Image("http://project-isd.appspot.com/Banner.jpg");
	
	@Override
	public void onModuleLoad() {
	
		// Tabpanel
		tp = new TabPanel();
		tp.setSize("900px", "500px");
		tp.setAnimationEnabled(true);
		tp.add(eersteTab(), "Vak Toevoegen");
		tp.add(tweedeTab(), "Leerling Toevoegen");
		tp.add(tp3, "Klas Toevoegen");
		tp.add(tp4, "Lesuren Toevoegen");
		tp.add(tp5, "Leraar Toevoegen");
		tp.selectTab(0);
		final Label lb1 = new Label();
		final Label lb2 = new Label();
		final Label lb3 = new Label();
		tp3.add(lb1);
		tp4.add(lb2);
		tp5.add(lb3);

	
		
		RootPanel.get("main").add(newBanner);
		RootPanel.get("main").add(tp);
		
		
	}
	// Dit is Tab 1
	public Panel eersteTab() {
		VerticalPanel myPanel = new VerticalPanel();
		Label myTitelLabel = new Label();
		myPanel.add(myTitelLabel);
		myTitelLabel.setText("Vaktoevoegen: ");
		VerticalPanel hp1 = new VerticalPanel();
		Label myLabel = new Label();
		hp1.add(myLabel);
		myLabel.setText("Cursuscode");
		TextBox myTextBox = new TextBox();
		hp1.add(myTextBox);
		myTextBox.setText("Geef Cursuscode");
		myTextBox.setVisibleLength(25);
		VerticalPanel hp2 = new VerticalPanel();
		Label myLabel1 = new Label();
		hp2.add(myLabel1);
		myLabel1.setText("Cursusnaam");
		TextBox myTextBox1 = new TextBox();
		hp2.add(myTextBox1);
		myTextBox1.setText("Geef Cursusnaam");
		myTextBox1.setVisibleLength(25);
		VerticalPanel hp3 = new VerticalPanel();
		Label myLabel2 = new Label();
		hp3.add(myLabel2);
		myLabel2.setText("Omschrijving");
		TextArea myTextArea = new TextArea();
		hp3.add(myTextArea);
		myTextArea.setText("Geef Omschrijving");
		HorizontalPanel hp4 = new HorizontalPanel();
		Button myButton1 = new Button("Cancel");
		Button myButton = new Button("Vak toevoegen");
		myButton.addClickHandler(new ClickHandler() {

			@Override
			public void onClick(ClickEvent event) {
				Window.alert("Kan momenteel gegevens niet in de database invoeren");
			}

		});
		hp4.add(myButton1);
		hp4.add(myButton);
		HorizontalPanel hp5 = new HorizontalPanel();
		Image myHulogo = new Image("http://project-isd.appspot.com/hu.jpg");
		hp5.add(myHulogo);

		// Grid opmaak vaktoevoegen
		Grid myGrid = new Grid(6, 3);
		myGrid.setWidget(0, 0, myTitelLabel);
		myGrid.setWidget(0, 2, myHulogo);
		myGrid.setWidget(2, 0, myLabel);
		myGrid.setWidget(2, 1, myTextBox);
		myGrid.setWidget(3, 0, myLabel1);
		myGrid.setWidget(3, 1, myTextBox1);
		myGrid.setWidget(4, 0, myLabel2);
		myGrid.setWidget(4, 1, myTextArea);
		myGrid.setWidget(5, 0, myButton1);
		myGrid.setWidget(5, 1, myButton);
		
		// Einde tussen en vaktoevoegenpanel
		myPanel.add(hp1);
		myPanel.add(hp2);
		myPanel.add(hp3);
		myPanel.add(hp4);
		myPanel.add(hp5);
		myPanel.add(myGrid);
		return myPanel;
	}
	
	public Panel tweedeTab() {
		VerticalPanel myLeerlingPanel2 = new VerticalPanel();
		Label myTitelLabelb = new Label();
		myTitelLabelb.setText("Leerlingtoevoegen: ");
		myLeerlingPanel2.add(myTitelLabelb);
		VerticalPanel hp1b = new VerticalPanel();
		Label myLabelb = new Label();
		hp1b.add(myLabelb);
		myLabelb.setText("Naam");
		TextBox myTextBoxb = new TextBox();
		myTextBoxb.setText("Geef Naam");
		myTextBoxb.setVisibleLength(25);
		hp1b.add(myTextBoxb);
		VerticalPanel hp2b = new VerticalPanel();
		Label myLabel2b = new Label();
		hp2b.add(myLabel2b);
		myLabel2b.setText("Adres");
		TextBox myTextBox2b = new TextBox();
		myTextBox2b.setText("Geef Straatnaam");
		myTextBox2b.setVisibleLength(25);
		hp2b.add(myTextBox2b);
		VerticalPanel hp3b = new VerticalPanel();
		TextBox myTextBox3b = new TextBox();
		myTextBox3b.setText("Geef Postcode");
		myTextBox3b.setVisibleLength(25);
		hp3b.add(myTextBox3b);
		VerticalPanel hp4b = new VerticalPanel();
		Label myLabel4b = new Label();
		hp4b.add(myLabel4b);
		myLabel4b.setText("Woonplaats");
		TextBox myTextBox4b = new TextBox();
		myTextBox4b.setText("Geef woonplaats");
		myTextBox4b.setVisibleLength(25);
		hp4b.add(myTextBox4b);
		VerticalPanel hp5b = new VerticalPanel();
		Label myLabel5b = new Label();
		hp5b.add(myLabel5b);
		myLabel5b.setText("Geboortedatum");
		TextBox myTextBox5b = new TextBox();
		myTextBox5b.setText("Geef geboortedatum");
		myTextBox5b.setVisibleLength(25);
		hp5b.add(myTextBox5b);
		HorizontalPanel hp6b = new HorizontalPanel();
		Button myButton1b = new Button("Cancel");
		Button myButtonb = new Button("Leerling toevoegen");
		myButtonb.addClickHandler(new ClickHandler() {

			@Override
			public void onClick(ClickEvent event) {
				Window.alert("Kan momenteel gegevens niet in de database invoeren");
			}

		});
		
		hp6b.add(myButton1b);
		hp6b.add(myButtonb);
		HorizontalPanel hp7b = new HorizontalPanel();
		Image myHulogob = new Image("http://project-isd.appspot.com/hu.jpg");
		hp7b.add(myHulogob);
		
		// Grib opmaak
		Grid myGridb = new Grid(8, 3);
		myGridb.setWidget(0, 0, myTitelLabelb);
		myGridb.setWidget(0, 2, myHulogob);
		myGridb.setWidget(2, 0, myLabelb);
		myGridb.setWidget(2, 1, myTextBoxb);
		myGridb.setWidget(3, 0, myLabel2b);
		myGridb.setWidget(3, 1, myTextBox2b);
		myGridb.setWidget(4, 1, myTextBox3b);
		myGridb.setWidget(5, 0, myLabel4b);
		myGridb.setWidget(5, 1, myTextBox4b);
		myGridb.setWidget(6, 0, myLabel5b);
		myGridb.setWidget(6, 1, myTextBox5b);
		myGridb.setWidget(7, 0, myButton1b);
		myGridb.setWidget(7, 1, myButtonb);
		

		
		// Einde tussenapnnels en hoofdpannels
		myLeerlingPanel2.add(hp1b);
		myLeerlingPanel2.add(hp2b);
		myLeerlingPanel2.add(hp3b);
		myLeerlingPanel2.add(hp4b);
		myLeerlingPanel2.add(hp5b);
		myLeerlingPanel2.add(hp6b);
		myLeerlingPanel2.add(hp7b);
		myLeerlingPanel2.add(myGridb);
		return myLeerlingPanel2;
	}
		
}
	
